function runInMs(title = "runIn300ms", ms = 300) {
  console.time(title);
  let i = 1;
  const length = ms * 1000000;
  while (i < length) {
    i++;
  }
  console.timeEnd(title);
}

function mockFetch() {
  return new Promise((resolve) => {
    runInMs("runIn1000ms in promise", 1000);
    resolve("我来执行 Promise resolved");
  });
}

async function doSomething() {
  console.log("我第一步执行");
  const futureData = await mockFetch();
  console.log(futureData);
}

doSomething();

console.log("我第二步执行");
